import { getDoctorList,getDoctorTotal } from '../../utils/api'
export default {
    namespaced: true,
    state: {
        doctorList: [],
        doctorTotal:0
    },
    mutations: {
        doctorListInit(state, payload) {
            state.doctorList = payload
        },
        doctorTotalInit(state, payload) {
            state.doctorTotal = payload
        }
    },
    actions: {
        // payload={page,size}
        async getDoctorListAction({ commit }, payload) {
            const { data } = await getDoctorList(payload)
            if (data.code === 200) {
                commit('doctorListInit', data.data)
            }
        },
        async getDoctorTotalAction({ commit }) {
            const { data } = await getDoctorTotal()
            if (data.code === 200) {
                commit('doctorTotalInit', data.data)
            }
        }
    }
}